package com.example.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * User:xieChao
 * Date:2022/12/1 13:33
 */
@Controller
public class UserController {

//    @Value("${server.port}")
//    private String port;
//
//    @ResponseBody //返回一个非静态页面的数据
//    @RequestMapping("/sayhi") // 设置路由地址。(全部是小写)
//  public String sayHi1(){
//
////        return "hello Spring Boot!";
//        return port;
//  }

  @Autowired
    private TestStudent student;

    @ResponseBody //返回一个非静态页面的数据
    @RequestMapping("/sayhi") // 设置路由地址。(全部是小写)
    public TestStudent sayHi(){
        return student;
    }

}
